﻿ 

	
<!DOCTYPE html>  
<html>  
<head>  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <meta name="keywords" content="人才简历">  
    <meta name="description" content="人才简历">  
    <title>人才简历查询</title>  
    
    <%@ include file="/WEB-INF/inc/default.jsp"%>
    <jsp:include page="/WEB-INF/inc/dic.jsp"/>

</head>  
  <script>
      
         function doSelect(pcallback){
           var rows = $('#dg').datagrid('getSelections');
            if (!rows||rows.length==0){
            	 $.messager.alert('提示','请选择行','info');
            	 return;
            }
            if (!rows||rows.length>1){
            	 $.messager.alert('提示','不能选择多行','info');
            	 return;
            }

            var cv={};
            cv.id=rows[0].id;
            cv.name=rows[0].cvName;
            if (rows){  
                if (callback) callback(cv);
                //else if (parent.chooseCv) parent.chooseCv(cv);    //否则执行默认父级选择函数
                closeWin();
            }  
         }
       
  </script>
<body>  
    
      
    <table id="dg" title="人才简历查询" style="width:1100px;height:300px"  
            url="/talent/cv/list.do"  
            toolbar="#toolbar" pagination="true"  
            rownumbers="true" fitColumns="true" loadMsg="正在查询,请稍候..." singleSelect="false">  

    </table>  
    <div  style="text-align:center">  
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="doSelect();">确定</a>  
          <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="closeWin()">关闭</a>  

    </div>
    <div id="toolbar">          
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="find()">查询</a>
    </div>
    <div id="dlg_query" style="display:none;">  
    	  <!--
    	  <div itemId="tab_panel" class="easyui-tabs" style="width:500px;height:200px">
    	        <div title="基本查询"  style="padding:10px"> 
                  <div class="ftitle">人才简历</div>  
                  <form itemId="fmquery" method="post" novalidate>                            
	                  		     <div class="fitem">  
                               <label style="width:100px">姓名:</label>                                            
                               <input name="cvName" class="easyui-box">                       
                             </div> 
	                  		     <div class="fitem">  
                               <label style="width:100px">英文名:</label>                                            
                               <input name="cvNameEn" class="easyui-box">                       
                             </div> 
	                  		     
	                </form>
	                
             </div>  
             <div title="高级查询"  style="padding:10px"> 
                  <div class="ftitle">人才简历</div>  
                  <form itemId="fmquery" method="post" novalidate>                            
	                  		     <div class="fitem">  
                               <label style="width:100px">姓名:</label>                                            
                               <input name="cvName" class="easyui-box">                       
                             </div> 
	                  		     <div class="fitem">  
                               <label style="width:100px">英文名:</label>                                            
                               <input name="cvNameEn" class="easyui-box">                       
                             </div> 
                             <div class="fitem">  
                               <label style="width:100px">年龄</label>                                            
                               <input name="age" class="easyui-box">                       
                             </div>
	                  		      
	                </form>
	                
            </div>    
            
        </div>
        <div  style="text-align:center">  
                    <a href="javascript:void(0)" itemId="btn-query" class="easyui-linkbutton" iconCls="icon-ok" ">查询</a>  
                    <a href="javascript:void(0)" itemId="btn-close" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>  
        </div>
	      -->
	 </div>        		     
    <script type="text/javascript">  
        var url;  
        var confWin;
      /*  
        function find(){  
              
                $('#dlg_query').dialog('open').dialog('setTitle','查询');  
                
                url = '/talent/cv/jsonlist.do';  
              
        } 
      */  
     function find(){
     	   if (confWin)
     	        confWin.window('open');
			    else confWin = $.window({
			    	title:"查询",
			    	tplRef:"dlg_query",//这个属性指定模板id
			    	height:200,
			    	onComplete:function(){
			    		//窗口里面的初始化,最好是在这个事件里面进行
			    		var curWin=this;
			    		
			    		
			    		this.find('a[itemId="btn-query"]').click(function(){
			    		
			    			  if (!curWin.curForm) curWin.curForm=curWin.find('form[itemId="fmquery"]');
			    			  //console.log(curWin.curForm);
			    			  curWin.window('close');
			    			  var formdata=curWin.curForm.formToArray();   		 
		              curWin.openerWin.query(formdata);
			    		});
			    		this.find('a[itemId="btn-close"]').click(function(){
			    			  curWin.window('close');
			    	  });
			    	  
			    	  
			    	  this.find('div[itemId="tab_panel"]').tabs({
        	          onSelect: function(title,index){        	          
        	          	var tab=curWin.find('div[itemId="tab_panel"]').tabs('getTab', index);        	          
        	          	curWin.curForm=tab.find('form[itemId="fmquery"]');  
        	          	//console.log(curWin.curForm);
        	          	        	          	
        	          }
             }); 
			    	  
			    		
			    	}
			    });
			    confWin.openerWin=window;
			    
		 }	
		 
		 function query(formdata){  
                
                $('#dg').datagrid({
	                  queryParams: array2json(formdata)
                });
              
        }
        
        
        //生成grid的字段,需要字典的自动转换
        $('#dg').datagrid({
        	   columns:[[
        	   	   {field:'id',title:'编号', width:100}
        	   	   ,{field:'cvName',title:'姓名', width:100}
        	   	   ,{field:'cvNameEn',title:'英文名', width:100}
        	   	   ,{field:'company',title:'现任职公司', width:100}
        	   	   ,{field:'title',title:'现任职职位', width:100}
        	   	    ,{field:'sex',title:'性别', width:100,
        	   		      formatter: function(value,row,index){
        	   		      	return __getConstantCategoryCodeValue('SEX', value);
        	   		      }
        	   	     }
        	   	     ,{field:'mobile',title:'手机', width:100}
        	   	   ,{field:'function',title:'职能', width:100,
        	   		      formatter: function(value,row,index){
        	   		      	return __getCategroyCodeValue('JOB', value);
        	   		      }
        	   	     }
        	   	   ,{field:'level',title:'职级：从字典选择', width:100,
        	   		      formatter: function(value,row,index){
        	   		      	return __getCategroyCodeValue('JOBLEVEL', value);
        	   		      }
        	   	     }
        	   	    ,{field:'degree',title:'学历', width:100,
        	   		      formatter: function(value,row,index){
        	   		      	return __getCategroyCodeValue('DEGREE', value);
        	   		      }
        	   	     } 
        	   	     ,{field:'workYear',title:'工作年限', width:100}        	   	           	   	   
        	   	   ,{field:'expectLocation',title:'期望工作地点', width:100,
        	   		      formatter: function(value,row,index){
        	   		      	return __getCategroyCodeValue('LOCATION', value);
        	   		      }
        	   	     }
        	   	   
        	   	
        	   	
        	   ]]
        	   ,onDblClickRow: function(rowIndex, rowData){
        	    	$('#dlg').dialog('open').dialog('setTitle','修改人才简历');                  
                $('#fm').form('load','/talent/cv/get.do?id='+rowData.id);  
                url = '/talent/cv/update.do';        	    	
        	    }
        }); 
        //完成-生成grid的字段
        
        
        
    </script>  
     
     

     
     
     
</body>  
</html>